package com.bwie.controller;

import com.bwie.pojo.TbGroupActive;
import com.bwie.service.TbGroupActiveService;
import com.bwie.utils.R;
import com.bwie.vo.ActiveVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @author 小薛超人
 * @version 1.0
 * @description: TODO
 * @date 2025/7/28 9:40
 */
@RestController
@RequestMapping("/active/index")
@Api(tags = "活动操作")
public class IndexController {

    @Autowired
    TbGroupActiveService tbGroupActiveService;

    @PostMapping("/activeList")
    @ApiOperation(value = "活动列表")
    public R activeList(@RequestBody ActiveVo activeVo){
        return tbGroupActiveService.activeList(activeVo);
    }

    @PostMapping("/addActive")
    @ApiOperation(value = "添加活动列表")
    public R addActive(@RequestBody @Validated TbGroupActive tbGroupActive){
        return tbGroupActiveService.addActive(tbGroupActive);
    }

    @PostMapping("/updateActive")
    @ApiOperation(value = "修改活动列表")
    public R updateActive(@RequestBody @Validated TbGroupActive tbGroupActive){
        return tbGroupActiveService.updateActive(tbGroupActive);
    }

    @PostMapping("/deleteActive/{activeId}")
    @ApiOperation(value = "删除活动")
    public R deleteActive(@PathVariable("activeId") Integer activeId){
        return tbGroupActiveService.deleteActive(activeId);
    }

}
